<?php if(!defined('HDPHP_PATH'))EXIT;
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."hd_admin`");
$db->exe("CREATE TABLE `hd_admin` (
  `aid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(20) NOT NULL DEFAULT '' COMMENT '用户名',
  `passwd` char(32) NOT NULL DEFAULT '' COMMENT '密码',
  `logintime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登录时间',
  `loginip` char(20) NOT NULL DEFAULT '',
  `lock` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '0为没有锁定，1为锁定',
  PRIMARY KEY (`aid`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='后台用户表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."hd_answer`");
$db->exe("CREATE TABLE `hd_answer` (
  `anid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `content` varchar(255) NOT NULL DEFAULT '' COMMENT '回答内容',
  `time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '回答时间',
  `accept` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0为没有被采纳，1为已经采纳',
  `uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属用户ID',
  `asid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属问题ID',
  PRIMARY KEY (`anid`),
  KEY `fk_hd_answer_hd_user_idx` (`uid`),
  KEY `fk_hd_answer_hd_ask1_idx` (`asid`)
) ENGINE=MyISAM AUTO_INCREMENT=34 DEFAULT CHARSET=utf8 COMMENT='回答表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."hd_ask`");
$db->exe("CREATE TABLE `hd_ask` (
  `asid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `content` varchar(255) NOT NULL DEFAULT '' COMMENT '提问内容',
  `time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '提问时间',
  `solve` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0为没有解决，1为已经解决',
  `answer` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '回答数',
  `reward` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '悬赏金币',
  `uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属用户ID',
  `cid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属分类ID',
  PRIMARY KEY (`asid`),
  KEY `fk_hd_ask_hd_user1_idx` (`uid`),
  KEY `fk_hd_ask_hd_category1_idx` (`cid`)
) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='提问表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."hd_category`");
$db->exe("CREATE TABLE `hd_category` (
  `cid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(20) NOT NULL DEFAULT '' COMMENT '分类名称',
  `pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父级ID',
  PRIMARY KEY (`cid`)
) ENGINE=MyISAM AUTO_INCREMENT=215 DEFAULT CHARSET=utf8 COMMENT='分类表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."hd_user`");
$db->exe("CREATE TABLE `hd_user` (
  `uid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(20) NOT NULL DEFAULT '' COMMENT '用户名',
  `passwd` char(32) NOT NULL DEFAULT '' COMMENT '密码',
  `ask` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '提问数',
  `answer` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '回答数',
  `accept` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '采纳数',
  `point` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '金币',
  `exp` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '经验',
  `restime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册时间',
  `logintime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登录时间',
  `loginip` char(20) NOT NULL DEFAULT '' COMMENT '登录IP',
  `lockuser` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `face` varchar(60) NOT NULL DEFAULT '' COMMENT '头像',
  PRIMARY KEY (`uid`),
  UNIQUE KEY `username_UNIQUE` (`username`)
) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COMMENT='前台用户表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."article`");
$db->exe("CREATE TABLE `".$db_prefix."article` (
  `aid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '文章表主键id',
  `title` char(120) NOT NULL DEFAULT '' COMMENT '文章标题',
  `click` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '点击次数',
  `sendtime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '发表时间',
  `updatetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间，自动更新',
  `thumb` varchar(100) NOT NULL DEFAULT '' COMMENT '缩略图',
  `is_recycle` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '0为没有进入的回收站，1为在回收站中',
  `digest` varchar(255) NOT NULL DEFAULT '' COMMENT '文章摘要',
  `attr` set('图文','推荐','热门','置顶') DEFAULT NULL COMMENT '文章属性',
  `author` char(15) NOT NULL DEFAULT 'admin' COMMENT '作者',
  `category_cid` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '所属分类id',
  `user_uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属用户id',
  PRIMARY KEY (`aid`),
  KEY `fk_cmd_article_cms_category_idx` (`category_cid`),
  KEY `fk_article_user1_idx` (`user_uid`)
) ENGINE=MyISAM AUTO_INCREMENT=114 DEFAULT CHARSET=utf8 COMMENT='文章表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."article_data`");
$db->exe("CREATE TABLE `".$db_prefix."article_data` (
  `keywords` varchar(125) NOT NULL DEFAULT '' COMMENT '关键字',
  `description` varchar(255) NOT NULL DEFAULT '' COMMENT '描述',
  `content` text COMMENT '文章内容',
  `article_aid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属文章id',
  KEY `fk_article_data_article1_idx` (`article_aid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='文章分离表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."article_tag`");
$db->exe("CREATE TABLE `".$db_prefix."article_tag` (
  `article_aid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属文章id',
  `tag_tid` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '所属标签id',
  `category_cid` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '所属分类id',
  KEY `fk_article_tag_article1_idx` (`article_aid`),
  KEY `fk_article_tag_tag1_idx` (`tag_tid`),
  KEY `fk_article_tag_category1_idx` (`category_cid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='文章与标签关联表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."category`");
$db->exe("CREATE TABLE `".$db_prefix."category` (
  `cid` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT '分类表主键id',
  `cname` char(20) NOT NULL DEFAULT '' COMMENT '分类名称',
  `pid` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '父级id',
  `ctitle` varchar(60) NOT NULL DEFAULT '' COMMENT '分类标题',
  `cdes` varchar(255) NOT NULL DEFAULT '' COMMENT '分类描述',
  `ckeywords` varchar(120) NOT NULL DEFAULT '' COMMENT '关键字',
  `csort` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '分类排序',
  `htmldir` varchar(50) NOT NULL DEFAULT '' COMMENT '静态目录',
  `is_listhtml` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '列表页是否生成静态',
  `is_archtml` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '内容页是否生成静态',
  `is_show` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '是否显示分类,0为不显示，1为显示',
  PRIMARY KEY (`cid`)
) ENGINE=MyISAM AUTO_INCREMENT=39 DEFAULT CHARSET=utf8 COMMENT='分类表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."comment`");
$db->exe("CREATE TABLE `".$db_prefix."comment` (
  `coid` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT '评论主键id',
  `pid` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '父级id',
  `comcon` varchar(255) NOT NULL DEFAULT '' COMMENT '评论内容',
  `addtime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '发表时间',
  `user_uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属用户uid',
  `article_aid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属文章aid',
  PRIMARY KEY (`coid`),
  KEY `fk_comment_user1_idx` (`user_uid`),
  KEY `fk_comment_article1_idx` (`article_aid`)
) ENGINE=MyISAM AUTO_INCREMENT=53 DEFAULT CHARSET=utf8 COMMENT='文章评论表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."config`");
$db->exe("CREATE TABLE `".$db_prefix."config` (
  `coid` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(15) NOT NULL DEFAULT '' COMMENT '配置项名称',
  `value` varchar(70) NOT NULL DEFAULT '' COMMENT '配置值',
  `title` varchar(45) NOT NULL DEFAULT '' COMMENT '配置项标题',
  `des` varchar(255) NOT NULL DEFAULT '' COMMENT '配置项详细描述',
  `type_id` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '配置项类型id，相同类型id相同',
  PRIMARY KEY (`coid`)
) ENGINE=MyISAM AUTO_INCREMENT=28 DEFAULT CHARSET=utf8 COMMENT='站点配置'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."config_copy`");
$db->exe("CREATE TABLE `".$db_prefix."config_copy` (
  `coid` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(15) NOT NULL DEFAULT '' COMMENT '配置项名称',
  `value` varchar(70) NOT NULL DEFAULT '' COMMENT '配置值',
  `title` varchar(45) NOT NULL DEFAULT '' COMMENT '配置项标题',
  `des` varchar(255) NOT NULL DEFAULT '' COMMENT '配置项详细描述',
  `type_id` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '配置项类型id，相同类型id相同',
  PRIMARY KEY (`coid`)
) ENGINE=MyISAM AUTO_INCREMENT=28 DEFAULT CHARSET=utf8 COMMENT='站点配置'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."flink`");
$db->exe("CREATE TABLE `".$db_prefix."flink` (
  `fid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '友情链接主键id',
  `fname` varchar(30) NOT NULL DEFAULT '' COMMENT '友情链接名称',
  `msg` varchar(150) NOT NULL DEFAULT '' COMMENT '友情链接描述',
  `addtime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `sort` smallint(5) unsigned NOT NULL DEFAULT '100' COMMENT '排序',
  `logo` varchar(80) NOT NULL DEFAULT '' COMMENT '友情链接Logo',
  `url` varchar(75) NOT NULL DEFAULT '' COMMENT '友情链接地址',
  `is_show` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '0为不显示，1为默认为显示',
  `is_logo` enum('0','1') NOT NULL DEFAULT '0' COMMENT '是否显示logo图片',
  PRIMARY KEY (`fid`)
) ENGINE=MyISAM AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 COMMENT='友情链接'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."tag`");
$db->exe("CREATE TABLE `".$db_prefix."tag` (
  `tid` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT '标签主键id',
  `tagname` char(26) NOT NULL DEFAULT '' COMMENT '标签名称',
  PRIMARY KEY (`tid`)
) ENGINE=MyISAM AUTO_INCREMENT=31 DEFAULT CHARSET=utf8 COMMENT='文章标签'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."user`");
$db->exe("CREATE TABLE `".$db_prefix."user` (
  `uid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户表主键id',
  `username` char(20) NOT NULL DEFAULT '' COMMENT '用户名',
  `nickname` varchar(25) NOT NULL DEFAULT '' COMMENT '昵称',
  `password` char(32) NOT NULL DEFAULT '' COMMENT '密码',
  `is_admin` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '0为普通用户，1为后台用户',
  `is_lock` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '是否锁定，0为没有锁定，1为锁定',
  `supper` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '超级管理员，不能被锁定，不能被删除,1为超级管理员，0为普通',
  PRIMARY KEY (`uid`),
  UNIQUE KEY `username_UNIQUE` (`username`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='用户表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."suning_brand`");
$db->exe("CREATE TABLE `suning_brand` (
  `bid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `brand_name` varchar(45) NOT NULL DEFAULT '',
  `brand_logo` varchar(200) NOT NULL DEFAULT '',
  `brand_sort` smallint(5) unsigned NOT NULL DEFAULT '0',
  `brand_hot` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`bid`),
  UNIQUE KEY `bid_UNIQUE` (`bid`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."suning_category`");
$db->exe("CREATE TABLE `suning_category` (
  `cid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `category_name` varchar(32) NOT NULL DEFAULT '',
  `pid` int(10) unsigned NOT NULL,
  `category_keywords` varchar(108) NOT NULL DEFAULT '',
  `category_keydescript` varchar(200) NOT NULL DEFAULT '',
  `category_sort` smallint(6) NOT NULL DEFAULT '0',
  `type_tid` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`cid`),
  UNIQUE KEY `cid_UNIQUE` (`cid`),
  KEY `fk_category_type1_idx` (`type_tid`)
) ENGINE=MyISAM AUTO_INCREMENT=1223 DEFAULT CHARSET=utf8");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."suning_comment`");
$db->exe("CREATE TABLE `suning_comment` (
  `cid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '评论id',
  `comment_title` varchar(100) NOT NULL DEFAULT '' COMMENT '评论标题',
  `comment_content` varchar(200) NOT NULL DEFAULT '' COMMENT '评论内容',
  `comment_start` int(10) unsigned NOT NULL DEFAULT '5' COMMENT '星级',
  `comment_addTime` int(11) NOT NULL DEFAULT '0',
  `comment_status` int(11) NOT NULL DEFAULT '0' COMMENT '评论状态',
  `commentcol` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '审核状态',
  `user_uid` int(10) unsigned NOT NULL,
  `goods_gid` int(10) unsigned NOT NULL,
  PRIMARY KEY (`cid`),
  UNIQUE KEY `cid_UNIQUE` (`cid`),
  KEY `fk_comment_user1_idx` (`user_uid`),
  KEY `fk_comment_goods1_idx` (`goods_gid`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."suning_config`");
$db->exe("CREATE TABLE `suning_config` (
  `coid` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(15) NOT NULL DEFAULT '' COMMENT '配置项名称',
  `value` varchar(70) NOT NULL DEFAULT '' COMMENT '配置值',
  `title` varchar(45) NOT NULL DEFAULT '' COMMENT '配置项标题',
  `des` varchar(255) NOT NULL DEFAULT '' COMMENT '配置项详细描述',
  `type_id` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '配置项类型id，相同类型id相同',
  PRIMARY KEY (`coid`)
) ENGINE=MyISAM AUTO_INCREMENT=28 DEFAULT CHARSET=utf8 COMMENT='站点配置'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."suning_goods`");
$db->exe("CREATE TABLE `suning_goods` (
  `gid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '商品id',
  `goods_name` varchar(200) NOT NULL DEFAULT '' COMMENT '商品名称',
  `goods_inventory` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '库存',
  `goods_addTime` int(11) NOT NULL DEFAULT '0' COMMENT '商品上架时间',
  `goods_click` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商品点击数量',
  `goods_market` decimal(6,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '市场价格',
  `goods_mall` decimal(6,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '商城价格',
  `goods_unit` enum('个','件','只','支','条') NOT NULL DEFAULT '件',
  `category_cid` int(10) unsigned NOT NULL,
  `type_tid` int(10) unsigned NOT NULL,
  `brand_bid` int(10) unsigned NOT NULL,
  `manager_mid` int(10) unsigned NOT NULL,
  `goods_recycle` int(11) NOT NULL DEFAULT '0' COMMENT '是否进回收站',
  `goods_nums` varchar(30) NOT NULL DEFAULT '0',
  `goods_hot` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`gid`),
  UNIQUE KEY `goods_nums_UNIQUE` (`goods_nums`),
  KEY `fk_goods_category1_idx` (`category_cid`),
  KEY `fk_goods_type1_idx` (`type_tid`),
  KEY `fk_goods_brand1_idx` (`brand_bid`),
  KEY `fk_goods_manager1_idx` (`manager_mid`)
) ENGINE=MyISAM AUTO_INCREMENT=1707 DEFAULT CHARSET=utf8 COMMENT='商品表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."suning_goods_attr`");
$db->exe("CREATE TABLE `suning_goods_attr` (
  `goods_attr_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `goods_attr_value` varchar(200) NOT NULL DEFAULT '' COMMENT '属性值',
  `goods_attr_price` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '附加价格',
  `goods_gid` int(10) unsigned NOT NULL,
  `type_attr_aid` int(10) unsigned NOT NULL,
  PRIMARY KEY (`goods_attr_id`),
  UNIQUE KEY `goods_attr_id_UNIQUE` (`goods_attr_id`),
  KEY `fk_goods_attr_goods1_idx` (`goods_gid`),
  KEY `fk_goods_attr_type_attr1_idx` (`type_attr_aid`)
) ENGINE=MyISAM AUTO_INCREMENT=252 DEFAULT CHARSET=utf8 COMMENT='商品属性'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."suning_goods_info`");
$db->exe("CREATE TABLE `suning_goods_info` (
  `goods_info_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '商品详情id',
  `goods_info_detail` text NOT NULL COMMENT '商品详情',
  `goods_info_smallIMg` varchar(200) NOT NULL DEFAULT '' COMMENT '小图',
  `goods_info_bigImg` varchar(200) NOT NULL DEFAULT '' COMMENT '大图',
  `goods_info_midImg` varchar(200) NOT NULL DEFAULT '' COMMENT '中图',
  `goods_info_sever` text NOT NULL COMMENT '售后服务',
  `goods_gid` int(10) unsigned NOT NULL,
  PRIMARY KEY (`goods_info_id`),
  KEY `fk_goods_info_goods1_idx` (`goods_gid`)
) ENGINE=MyISAM AUTO_INCREMENT=1721 DEFAULT CHARSET=utf8 COMMENT='商品详情信息表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."suning_goods_list`");
$db->exe("CREATE TABLE `suning_goods_list` (
  `goods_list_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '货品id',
  `goods_list_compositeAttrId` varchar(20) NOT NULL DEFAULT '0' COMMENT '组合属性id',
  `goods_list_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '货号',
  `goods_list_stock` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '库存',
  `goods_gid` int(10) unsigned NOT NULL,
  PRIMARY KEY (`goods_list_id`),
  UNIQUE KEY `goods_list_id_UNIQUE` (`goods_list_id`),
  KEY `fk_goods_list_goods1_idx` (`goods_gid`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='货品列表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."suning_manager`");
$db->exe("CREATE TABLE `suning_manager` (
  `mid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '管理员id',
  `manager_member` varchar(100) NOT NULL DEFAULT '' COMMENT '管理员账号',
  `manager_nikeName` varchar(100) NOT NULL DEFAULT '' COMMENT '管理员名称',
  `manager_password` varchar(100) NOT NULL DEFAULT '' COMMENT '管理员密码',
  `manager_loginTime` int(11) NOT NULL DEFAULT '0' COMMENT '登录时间',
  `manager_loingIp` varchar(100) NOT NULL DEFAULT '' COMMENT '登录ip',
  PRIMARY KEY (`mid`),
  UNIQUE KEY `mid_UNIQUE` (`mid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='管理员表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."suning_order_list`");
$db->exe("CREATE TABLE `suning_order_list` (
  `order_list_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '订单列表id',
  `order_list_nums` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '购买数量',
  `order_list_subtotal` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '小计',
  `order_list_comments` varchar(200) NOT NULL DEFAULT '' COMMENT '备注说明',
  `goods_gid` int(10) unsigned NOT NULL,
  `order_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '订单id',
  PRIMARY KEY (`order_list_id`),
  UNIQUE KEY `oid_UNIQUE` (`order_list_id`),
  KEY `fk_order_list_goods1_idx` (`goods_gid`)
) ENGINE=MyISAM AUTO_INCREMENT=42 DEFAULT CHARSET=utf8 COMMENT='订单列表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."suning_question`");
$db->exe("CREATE TABLE `suning_question` (
  `qid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `question_con` varchar(200) NOT NULL DEFAULT '' COMMENT '问题内容',
  `question_type` int(10) unsigned NOT NULL DEFAULT '6' COMMENT '问题分类',
  `question_answer` varchar(200) NOT NULL DEFAULT '' COMMENT '回复内容',
  `question_question_uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '提问用户id',
  `question_answer_uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '回复用户id',
  `question_addtime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '提问时间',
  `goods_gid` int(10) unsigned NOT NULL,
  `is_answer` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`qid`),
  KEY `fk_question_goods1_idx` (`goods_gid`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='用户咨询表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."suning_type`");
$db->exe("CREATE TABLE `suning_type` (
  `tid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `type_name` varchar(45) NOT NULL DEFAULT '',
  PRIMARY KEY (`tid`),
  UNIQUE KEY `tid_UNIQUE` (`tid`)
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."suning_type_attr`");
$db->exe("CREATE TABLE `suning_type_attr` (
  `aid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `attr_name` varchar(45) NOT NULL DEFAULT '',
  `attr_value` varchar(200) NOT NULL DEFAULT '',
  `attr_class` int(10) unsigned NOT NULL DEFAULT '0',
  `type_tid` int(10) unsigned NOT NULL,
  PRIMARY KEY (`aid`),
  UNIQUE KEY `vid_UNIQUE` (`aid`),
  KEY `fk_type_attr_type_idx` (`type_tid`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."suning_user`");
$db->exe("CREATE TABLE `suning_user` (
  `uid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(24) NOT NULL DEFAULT '',
  `password` varchar(32) NOT NULL DEFAULT '',
  `email` varchar(45) DEFAULT '',
  `tel` bigint(12) DEFAULT NULL,
  `address` varchar(200) DEFAULT '',
  `reg_time` int(11) NOT NULL,
  `login_time` int(11) NOT NULL,
  `is_admin` int(11) NOT NULL DEFAULT '0',
  `level` int(11) NOT NULL DEFAULT '0',
  `img_url` varchar(100) NOT NULL DEFAULT '''''',
  `name` varchar(45) NOT NULL DEFAULT '''''',
  `defalut_address` varchar(200) NOT NULL DEFAULT '''''',
  `addresss_book` text NOT NULL,
  `money` decimal(50,2) NOT NULL DEFAULT '0.00',
  `collect` text NOT NULL,
  PRIMARY KEY (`uid`),
  UNIQUE KEY `sername_UNIQUE` (`username`),
  UNIQUE KEY `uid_UNIQUE` (`uid`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."suning_user_address`");
$db->exe("CREATE TABLE `suning_user_address` (
  `address_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_address_name` varchar(45) NOT NULL DEFAULT '' COMMENT '收件人',
  `user_address_tel` varchar(12) NOT NULL DEFAULT '' COMMENT '用户地址手机',
  `user_address_phone` varchar(12) NOT NULL DEFAULT '' COMMENT '用户电话',
  `user_address_all` varchar(200) NOT NULL DEFAULT '' COMMENT '详细地址',
  `user_address_place` varchar(100) NOT NULL DEFAULT '' COMMENT '所在地',
  `user_address_isdefault` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '默认地址',
  `user_uid` int(10) unsigned NOT NULL,
  PRIMARY KEY (`address_id`),
  UNIQUE KEY `address_id_UNIQUE` (`address_id`),
  KEY `fk_user_address_user1_idx` (`user_uid`)
) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COMMENT='用户地址表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."suning_user_order`");
$db->exe("CREATE TABLE `suning_user_order` (
  `oid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '订单id',
  `order_nums` varchar(50) NOT NULL DEFAULT '0' COMMENT '订单号',
  `order_receiver` varchar(45) NOT NULL DEFAULT '' COMMENT '收件人',
  `order_address` varchar(200) NOT NULL DEFAULT '' COMMENT '收货地址',
  `order_amount` int(11) NOT NULL DEFAULT '0',
  `order_addTime` int(11) NOT NULL DEFAULT '0' COMMENT '订单添加时间',
  `order_comments` varchar(200) NOT NULL DEFAULT '' COMMENT '订单备注',
  `order_status` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '订单状态',
  `user_uid` int(10) unsigned NOT NULL,
  `order_list_order_list_di` int(10) unsigned NOT NULL,
  ` order_user_tel` varchar(12) NOT NULL DEFAULT '' COMMENT '手机号',
  `order_user_place` varchar(200) NOT NULL DEFAULT '' COMMENT '所在区域',
  `order_phone` varchar(12) NOT NULL DEFAULT '' COMMENT '电话',
  `order_payway` int(1) unsigned NOT NULL DEFAULT '0' COMMENT '支付方式',
  PRIMARY KEY (`oid`),
  UNIQUE KEY `oid_UNIQUE` (`oid`),
  KEY `fk_order_user1_idx` (`user_uid`),
  KEY `fk_order_order_list1_idx` (`order_list_order_list_di`)
) ENGINE=MyISAM AUTO_INCREMENT=31 DEFAULT CHARSET=utf8 COMMENT='订单表'");
